package com.eastcode.base.view;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import com.eastcode.base.constants.Constants;
import com.eastcode.mobile.server.util.ServerConstant;

public class BaseView extends PageCountView {
	/** 查询条件 **/
	private String queryCondition = "";

	/** 删除条件 **/
	private String deleteCondition = "";

	/** 所选记录ID **/
	private String ids;

	/** 所选记录ID **/
	private long id;

	/** 数据结果集 **/
	private Object result;

	/** 数据状态map表 **/
	private Map<String, String> stateMap = ServerConstant.stateMap;

	/** YesNo表 **/
	private Map<String, String> yesNoMap;

	/** 查询参数 **/
	private Map<String, String> paramMap;

	/** 错误信息 **/
	private String errorMessage;

	/** 时间戳 **/
	private String timestamp;

	/** 状态 **/
	private String enable;

	/**
	 * 获取查询条件
	 * 
	 * @return
	 */
	public String getQueryCondition() {
		return queryCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param queryCondition
	 */
	public void setQueryCondition(String queryCondition) {
		this.queryCondition = queryCondition;
	}

	/**
	 * 获取删除条件
	 * 
	 * @return
	 */
	public String getDeleteCondition() {
		return deleteCondition;
	}

	/**
	 * 设置删除条件
	 * 
	 * @param deleteCondition
	 */
	public void setDeleteCondition(String deleteCondition) {
		this.deleteCondition = deleteCondition;
	}

	/**
	 * 获取所选记录ID集
	 * 
	 * @return
	 */
	public String getIds() {
		return ids;
	}

	/**
	 * 设置记录ID集
	 * 
	 * @param ids
	 */
	public void setIds(String ids) {
		this.ids = ids;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

	public Map<String, String> getStateMap() {
		stateMap = ServerConstant.stateMap;
		return stateMap;
	}

	public void setStateMap(Map<String, String> stateMap) {
		this.stateMap = stateMap;
	}

	/**
	 * 获取YES，NO MAP表
	 * 
	 * @return
	 */
	public Map<String, String> getYesNoMap() {
		yesNoMap = new LinkedHashMap<String, String>();
		yesNoMap.put(Constants.ENABLE, Constants.YES);
		yesNoMap.put(Constants.DISABLE, Constants.NO);
		return yesNoMap;
	}

	public void setYesNoMap(Map<String, String> yesNoMap) {
		this.yesNoMap = yesNoMap;
	}

	public Map<String, String> getParamMap() {
		if (paramMap == null) {
			paramMap = new HashMap<String, String>();
		}
		return paramMap;
	}

	public void setParamMap(Map<String, String> paramMap) {
		this.paramMap = paramMap;
	}

	/**
	 * 获取错误信息
	 * 
	 * @return
	 */
	public String getErrorMessage() {
		if (errorMessage == null) {
			errorMessage = "";
		}
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	/**
	 * 获取时间戳
	 * 
	 * @return
	 */
	public String getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}

	public String getEnable() {
		return enable;
	}

	public void setEnable(String enable) {
		this.enable = enable;
	}

}